package com.zian.context;

public class BaseContext {
    /**
     * 线程变量 , 每个线程都有自己独立的线程变量，并且每个线程都可以独立地改变自己的线程变量值
     *
     */
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
